
import java.awt.Color;
import javax.swing.JOptionPane;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmIndex.java
 *
 * Created on 28-jul-2011, 9:53:06
 */
/**
 *
 * @author Kid_goth
 */
public class frmIndex extends javax.swing.JFrame {
int val = 0;
String let = "";
String Palabra = "";
String pbra = "";
int num = 0;
int opo = 0;
String sub;
    /** Creates new form frmIndex */
    public frmIndex() {
        initComponents();
        Inicio();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblSB = new javax.swing.JLabel();
        lblCA = new javax.swing.JLabel();
        lblSM = new javax.swing.JLabel();
        lblRV = new javax.swing.JLabel();
        lblBD = new javax.swing.JLabel();
        lblPD = new javax.swing.JLabel();
        lblPI = new javax.swing.JLabel();
        lblSA = new javax.swing.JLabel();
        lblCS = new javax.swing.JLabel();
        lblBI = new javax.swing.JLabel();
        lblCU = new javax.swing.JLabel();
        lblRM = new javax.swing.JLabel();
        btnAct = new javax.swing.JButton();
        lblD = new javax.swing.JLabel();
        lblE = new javax.swing.JLabel();
        lblL = new javax.swing.JLabel();
        lblC = new javax.swing.JLabel();
        lblA = new javax.swing.JLabel();
        lblB = new javax.swing.JLabel();
        lblF = new javax.swing.JLabel();
        lblG = new javax.swing.JLabel();
        lblH = new javax.swing.JLabel();
        lblI = new javax.swing.JLabel();
        lblJ = new javax.swing.JLabel();
        lblO = new javax.swing.JLabel();
        lblK = new javax.swing.JLabel();
        lblZ = new javax.swing.JLabel();
        lblN = new javax.swing.JLabel();
        lblM = new javax.swing.JLabel();
        lblP = new javax.swing.JLabel();
        lblQ = new javax.swing.JLabel();
        lblR = new javax.swing.JLabel();
        lblS = new javax.swing.JLabel();
        lblT = new javax.swing.JLabel();
        lblU = new javax.swing.JLabel();
        lblV = new javax.swing.JLabel();
        lblW = new javax.swing.JLabel();
        lblX = new javax.swing.JLabel();
        lblY = new javax.swing.JLabel();
        lbl10 = new javax.swing.JLabel();
        lbl1 = new javax.swing.JLabel();
        lbl2 = new javax.swing.JLabel();
        lbl3 = new javax.swing.JLabel();
        lbl4 = new javax.swing.JLabel();
        lbl5 = new javax.swing.JLabel();
        lbl6 = new javax.swing.JLabel();
        lbl7 = new javax.swing.JLabel();
        lbl8 = new javax.swing.JLabel();
        lbl9 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        panelRoundTranslucido1 = new org.edisoncor.gui.panel.PanelRoundTranslucido();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("JAhorcado - Created by KidGoth");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });
        getContentPane().setLayout(null);

        lblSB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/sopAba.png"))); // NOI18N
        getContentPane().add(lblSB);
        lblSB.setBounds(200, 320, 135, 45);

        lblCA.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblCA.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/cuerdaApretada.png"))); // NOI18N
        getContentPane().add(lblCA);
        lblCA.setBounds(132, 70, 40, 120);

        lblSM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/sopMed.png"))); // NOI18N
        getContentPane().add(lblSM);
        lblSM.setBounds(260, 40, 10, 280);

        lblRV.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/cabezaViva.png"))); // NOI18N
        getContentPane().add(lblRV);
        lblRV.setBounds(117, 96, 74, 80);

        lblBD.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblBD.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/brazoDer.png"))); // NOI18N
        getContentPane().add(lblBD);
        lblBD.setBounds(114, 165, 40, 50);

        lblPD.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/piernaDer.png"))); // NOI18N
        getContentPane().add(lblPD);
        lblPD.setBounds(116, 247, 50, 80);

        lblPI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/piernaIzq.png"))); // NOI18N
        getContentPane().add(lblPI);
        lblPI.setBounds(152, 247, 50, 80);

        lblSA.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/sopArr.png"))); // NOI18N
        getContentPane().add(lblSA);
        lblSA.setBounds(150, 20, 120, 80);

        lblCS.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblCS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/cuerdaFloja.png"))); // NOI18N
        getContentPane().add(lblCS);
        lblCS.setBounds(98, 67, 110, 120);

        lblBI.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblBI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/brazoIzq.png"))); // NOI18N
        getContentPane().add(lblBI);
        lblBI.setBounds(152, 170, 40, 40);

        lblCU.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblCU.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/cuerpo.png"))); // NOI18N
        getContentPane().add(lblCU);
        lblCU.setBounds(134, 155, 40, 120);

        lblRM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/_img_/cabezaMuerta.png"))); // NOI18N
        getContentPane().add(lblRM);
        lblRM.setBounds(117, 96, 74, 80);

        btnAct.setText("Nuevo");
        btnAct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnActActionPerformed(evt);
            }
        });
        getContentPane().add(btnAct);
        btnAct.setBounds(20, 20, 75, 23);

        lblD.setText("D");
        lblD.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblDMouseClicked(evt);
            }
        });
        getContentPane().add(lblD);
        lblD.setBounds(80, 80, 20, 30);

        lblE.setText("E");
        lblE.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblEMouseClicked(evt);
            }
        });
        getContentPane().add(lblE);
        lblE.setBounds(20, 120, 20, 30);

        lblL.setText("L");
        lblL.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblLMouseClicked(evt);
            }
        });
        getContentPane().add(lblL);
        lblL.setBounds(80, 160, 20, 30);

        lblC.setText("C");
        lblC.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblCMouseClicked(evt);
            }
        });
        getContentPane().add(lblC);
        lblC.setBounds(60, 80, 20, 30);

        lblA.setText("A");
        lblA.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblAMouseClicked(evt);
            }
        });
        getContentPane().add(lblA);
        lblA.setBounds(20, 80, 20, 30);

        lblB.setText("B");
        lblB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblBMouseClicked(evt);
            }
        });
        getContentPane().add(lblB);
        lblB.setBounds(40, 80, 20, 30);

        lblF.setText("F");
        lblF.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblFMouseClicked(evt);
            }
        });
        getContentPane().add(lblF);
        lblF.setBounds(40, 120, 20, 30);

        lblG.setText("G");
        lblG.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblGMouseClicked(evt);
            }
        });
        getContentPane().add(lblG);
        lblG.setBounds(60, 120, 20, 30);

        lblH.setText("H");
        lblH.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblHMouseClicked(evt);
            }
        });
        getContentPane().add(lblH);
        lblH.setBounds(80, 120, 20, 30);

        lblI.setText("I");
        lblI.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblIMouseClicked(evt);
            }
        });
        getContentPane().add(lblI);
        lblI.setBounds(20, 160, 20, 30);

        lblJ.setText("J");
        lblJ.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblJMouseClicked(evt);
            }
        });
        getContentPane().add(lblJ);
        lblJ.setBounds(40, 160, 20, 30);

        lblO.setText("O");
        lblO.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblOMouseClicked(evt);
            }
        });
        getContentPane().add(lblO);
        lblO.setBounds(60, 200, 20, 30);

        lblK.setText("K");
        lblK.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblKMouseClicked(evt);
            }
        });
        getContentPane().add(lblK);
        lblK.setBounds(60, 160, 20, 30);

        lblZ.setText("Z");
        lblZ.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblZMouseClicked(evt);
            }
        });
        getContentPane().add(lblZ);
        lblZ.setBounds(40, 320, 20, 30);

        lblN.setText("N");
        lblN.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblNMouseClicked(evt);
            }
        });
        getContentPane().add(lblN);
        lblN.setBounds(40, 200, 20, 30);

        lblM.setText("M");
        lblM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblMMouseClicked(evt);
            }
        });
        getContentPane().add(lblM);
        lblM.setBounds(20, 200, 20, 30);

        lblP.setText("P");
        lblP.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblPMouseClicked(evt);
            }
        });
        getContentPane().add(lblP);
        lblP.setBounds(80, 200, 20, 30);

        lblQ.setText("Q");
        lblQ.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblQMouseClicked(evt);
            }
        });
        getContentPane().add(lblQ);
        lblQ.setBounds(20, 240, 20, 30);

        lblR.setText("R");
        lblR.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblRMouseClicked(evt);
            }
        });
        getContentPane().add(lblR);
        lblR.setBounds(40, 240, 20, 30);

        lblS.setText("S");
        lblS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblSMouseClicked(evt);
            }
        });
        getContentPane().add(lblS);
        lblS.setBounds(60, 240, 20, 30);

        lblT.setText("T");
        lblT.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblTMouseClicked(evt);
            }
        });
        getContentPane().add(lblT);
        lblT.setBounds(80, 240, 20, 30);

        lblU.setText("U");
        lblU.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblUMouseClicked(evt);
            }
        });
        getContentPane().add(lblU);
        lblU.setBounds(20, 280, 20, 30);

        lblV.setText("V");
        lblV.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblVMouseClicked(evt);
            }
        });
        getContentPane().add(lblV);
        lblV.setBounds(40, 280, 20, 30);

        lblW.setText("W");
        lblW.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblWMouseClicked(evt);
            }
        });
        getContentPane().add(lblW);
        lblW.setBounds(60, 280, 20, 30);

        lblX.setText("X");
        lblX.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblXMouseClicked(evt);
            }
        });
        getContentPane().add(lblX);
        lblX.setBounds(80, 280, 20, 30);

        lblY.setText("Y");
        lblY.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblYMouseClicked(evt);
            }
        });
        getContentPane().add(lblY);
        lblY.setBounds(20, 320, 20, 30);

        lbl10.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl10.setText("_");
        getContentPane().add(lbl10);
        lbl10.setBounds(250, 390, 30, 30);

        lbl1.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl1.setText("_");
        getContentPane().add(lbl1);
        lbl1.setBounds(70, 390, 30, 30);

        lbl2.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl2.setText("_");
        getContentPane().add(lbl2);
        lbl2.setBounds(90, 390, 30, 30);

        lbl3.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl3.setText("_");
        getContentPane().add(lbl3);
        lbl3.setBounds(110, 390, 30, 30);

        lbl4.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl4.setText("_");
        getContentPane().add(lbl4);
        lbl4.setBounds(130, 390, 30, 30);

        lbl5.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl5.setText("_");
        getContentPane().add(lbl5);
        lbl5.setBounds(150, 390, 30, 30);

        lbl6.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl6.setText("_");
        getContentPane().add(lbl6);
        lbl6.setBounds(170, 390, 30, 30);

        lbl7.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl7.setText("_");
        getContentPane().add(lbl7);
        lbl7.setBounds(190, 390, 30, 30);

        lbl8.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl8.setText("_");
        getContentPane().add(lbl8);
        lbl8.setBounds(210, 390, 30, 30);

        lbl9.setFont(new java.awt.Font("Tahoma", 1, 18));
        lbl9.setText("_");
        getContentPane().add(lbl9);
        lbl9.setBounds(230, 390, 30, 30);

        jLabel1.setFont(new java.awt.Font("Old English Text MT", 1, 18));
        jLabel1.setText("?");
        jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel1MouseClicked(evt);
            }
        });
        getContentPane().add(jLabel1);
        jLabel1.setBounds(330, 400, 20, 20);
        getContentPane().add(panelRoundTranslucido1);
        panelRoundTranslucido1.setBounds(0, 0, 350, 440);

        jMenu1.setText("Ayuda");

        jMenuItem1.setText("Reglas");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem2.setText("Acerca De");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnActActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnActActionPerformed
        new frmNuevo().setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_btnActActionPerformed

    private void lblAMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblAMouseClicked
        
        if(lblA.getForeground() != Color.GRAY)
        {
            let = "A";
            lblA.setForeground(Color.GRAY);
            Validacion();
        }
    }//GEN-LAST:event_lblAMouseClicked

    private void lblBMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblBMouseClicked
        if(lblB.getForeground() != Color.GRAY)
        {
            let = "B";
            lblB.setForeground(Color.GRAY);
            Validacion();
        }
    }//GEN-LAST:event_lblBMouseClicked

    private void lblCMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblCMouseClicked
        if(lblC.getForeground() != Color.GRAY)
        {
            let = "C";
            lblC.setForeground(Color.GRAY);
            Validacion();
        }
    }//GEN-LAST:event_lblCMouseClicked

    private void lblDMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblDMouseClicked
        if(lblD.getForeground() != Color.GRAY)
        {
            let = "D";
            lblD.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblDMouseClicked

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        if(Palabra == "")
        {
            new frmNuevo().setVisible(true);
            this.setVisible(false);
        }
        else
        {
            switch (Palabra.length())
            {
                case 7:
                    lbl7.setVisible(true);
                    break;
                case 8:
                    lbl7.setVisible(true);
                    lbl8.setVisible(true);
                    break;
                case 9:
                    lbl7.setVisible(true);
                    lbl8.setVisible(true);
                    lbl9.setVisible(true);
                    break;
                case 10:
                    lbl7.setVisible(true);
                    lbl8.setVisible(true);
                    lbl9.setVisible(true);
                    lbl10.setVisible(true);
                    break;
            }
        }
    }//GEN-LAST:event_formWindowOpened

    private void lblEMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblEMouseClicked
        if(lblE.getForeground() != Color.GRAY)
        {
            let = "E";
            lblE.setForeground(Color.GRAY);
            Validacion();
        }
    }//GEN-LAST:event_lblEMouseClicked

    private void lblFMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblFMouseClicked
        if(lblF.getForeground() != Color.GRAY)
        {
            let = "F";
            lblF.setForeground(Color.GRAY);
            Validacion();
        }// TODO add your handling code here:
    }//GEN-LAST:event_lblFMouseClicked

    private void lblGMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblGMouseClicked
        if(lblG.getForeground() != Color.GRAY)
        {
            let = "G";
            lblG.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblGMouseClicked

    private void lblHMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblHMouseClicked
        if(lblH.getForeground() != Color.GRAY)
        {
            let = "H";
            lblH.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblHMouseClicked

    private void lblIMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblIMouseClicked
        if(lblI.getForeground() != Color.GRAY)
        {
            let = "I";
            lblI.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblIMouseClicked

    private void lblJMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblJMouseClicked
        if(lblJ.getForeground() != Color.GRAY)
        {
            let = "J";
            lblJ.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblJMouseClicked

    private void lblKMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblKMouseClicked
        if(lblK.getForeground() != Color.GRAY)
        {
            let = "K";
            lblK.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblKMouseClicked

    private void lblLMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblLMouseClicked
        if(lblL.getForeground() != Color.GRAY)
        {
            let = "L";
            lblL.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblLMouseClicked

    private void lblMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblMMouseClicked
        if(lblM.getForeground() != Color.GRAY)
        {
            let = "M";
            lblM.setForeground(Color.GRAY);
            Validacion();
        }        // TODO add your handling code here:
    }//GEN-LAST:event_lblMMouseClicked

    private void lblNMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblNMouseClicked
         if(lblN.getForeground() != Color.GRAY)
        {
            let = "N";
            lblN.setForeground(Color.GRAY);
            Validacion();
        }       // TODO add your handling code here:
    }//GEN-LAST:event_lblNMouseClicked

    private void lblOMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblOMouseClicked
         if(lblO.getForeground() != Color.GRAY)
        {
            let = "O";
            lblO.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblOMouseClicked

    private void lblPMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblPMouseClicked
         if(lblP.getForeground() != Color.GRAY)
        {
            let = "P";
            lblP.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblPMouseClicked

    private void lblQMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblQMouseClicked
         if(lblQ.getForeground() != Color.GRAY)
        {
            let = "Q";
            lblQ.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblQMouseClicked

    private void lblRMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblRMouseClicked
        if(lblR.getForeground() != Color.GRAY)
        {
            let = "R";
            lblR.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblRMouseClicked

    private void lblSMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblSMouseClicked
        if(lblS.getForeground() != Color.GRAY)
        {
            let = "S";
            lblS.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblSMouseClicked

    private void lblTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblTMouseClicked
        if(lblT.getForeground() != Color.GRAY)
        {
            let = "T";
            lblT.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblTMouseClicked

    private void lblUMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblUMouseClicked
        if(lblU.getForeground() != Color.GRAY)
        {
            let = "U";
            lblU.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblUMouseClicked

    private void lblVMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblVMouseClicked
        if(lblV.getForeground() != Color.GRAY)
        {
            let = "V";
            lblV.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblVMouseClicked

    private void lblWMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblWMouseClicked
        if(lblW.getForeground() != Color.GRAY)
        {
            let = "W";
            lblW.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblWMouseClicked

    private void lblXMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblXMouseClicked
        if(lblX.getForeground() != Color.GRAY)
        {
            let = "X";
            lblX.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblXMouseClicked

    private void lblYMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblYMouseClicked
        if(lblY.getForeground() != Color.GRAY)
        {
            let = "Y";
            lblY.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblYMouseClicked

    private void lblZMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblZMouseClicked
        if(lblZ.getForeground() != Color.GRAY)
        {
            let = "Z";
            lblZ.setForeground(Color.GRAY);
            Validacion();
        }         // TODO add your handling code here:
    }//GEN-LAST:event_lblZMouseClicked

    private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked
        JOptionPane.showMessageDialog(null, "La palabra era: "+ Palabra, "Respuesta", 1);        // TODO add your handling code here:
        Ocultar();
        val = 0;
        Palabra = "";
        Limpiar();
    }//GEN-LAST:event_jLabel1MouseClicked

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        JOptionPane.showMessageDialog(null, "No se Admiten Numeros, Espacios y/o la letra Ñ...\nMaximo 10 caracteres minimo 6...\n\n¡Que te Diviertas xD!", "Respuesta", 1);         // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        JOptionPane.showMessageDialog(null, "Tienes derecho a todo con este juego y/o source code\n¡Atrevete a Modificarlo!\n\nCreado por Brandon (KidGoth)...", "Respuesta", 1);        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
             // TODO add your handling code here:
    }//GEN-LAST:event_formWindowActivated

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new frmIndex().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAct;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JLabel lbl1;
    private javax.swing.JLabel lbl10;
    private javax.swing.JLabel lbl2;
    private javax.swing.JLabel lbl3;
    private javax.swing.JLabel lbl4;
    private javax.swing.JLabel lbl5;
    private javax.swing.JLabel lbl6;
    private javax.swing.JLabel lbl7;
    private javax.swing.JLabel lbl8;
    private javax.swing.JLabel lbl9;
    private javax.swing.JLabel lblA;
    private javax.swing.JLabel lblB;
    private javax.swing.JLabel lblBD;
    private javax.swing.JLabel lblBI;
    private javax.swing.JLabel lblC;
    private javax.swing.JLabel lblCA;
    private javax.swing.JLabel lblCS;
    private javax.swing.JLabel lblCU;
    private javax.swing.JLabel lblD;
    private javax.swing.JLabel lblE;
    private javax.swing.JLabel lblF;
    private javax.swing.JLabel lblG;
    private javax.swing.JLabel lblH;
    private javax.swing.JLabel lblI;
    private javax.swing.JLabel lblJ;
    private javax.swing.JLabel lblK;
    private javax.swing.JLabel lblL;
    private javax.swing.JLabel lblM;
    private javax.swing.JLabel lblN;
    private javax.swing.JLabel lblO;
    private javax.swing.JLabel lblP;
    private javax.swing.JLabel lblPD;
    private javax.swing.JLabel lblPI;
    private javax.swing.JLabel lblQ;
    private javax.swing.JLabel lblR;
    private javax.swing.JLabel lblRM;
    private javax.swing.JLabel lblRV;
    private javax.swing.JLabel lblS;
    private javax.swing.JLabel lblSA;
    private javax.swing.JLabel lblSB;
    private javax.swing.JLabel lblSM;
    private javax.swing.JLabel lblT;
    private javax.swing.JLabel lblU;
    private javax.swing.JLabel lblV;
    private javax.swing.JLabel lblW;
    private javax.swing.JLabel lblX;
    private javax.swing.JLabel lblY;
    private javax.swing.JLabel lblZ;
    private org.edisoncor.gui.panel.PanelRoundTranslucido panelRoundTranslucido1;
    // End of variables declaration//GEN-END:variables
    
    public void Validacion()
    {
        if(Palabra.contains(let))
        {
            pbra = Palabra;
            num = pbra.length();
            for(int i=1;i <= num; i++)
            {
                sub = pbra.substring(i-1, i);
                //JOptionPane.showMessageDialog(rootPane, sub+" "+let);
                if(let.equals(sub))
                {
                    opo++;
                    PonerLetra(i); 
                }                
            }
            if(opo == Palabra.length())
            {
                JOptionPane.showMessageDialog(null, "Excelente lo has Conseguido...", "Respuesta", 1);
                Ocultar();
                Palabra = "";
                JOptionPane.showMessageDialog(null, "Para Volver a Jugar da clic en Nuevo y Escribe la sig. palabra", "Respuesta", 1);
            }
        }
        else
        {
            Equivocado();
        }
        
    }
    
    public void Inicio()
    {
        this.setSize(355, 470);
        this.setResizable(false);
        this.setLocationRelativeTo(null);
        Ocultar();
    }
    public void Ocultar()
    {
        lblSM.setVisible(false);
        lblSA.setVisible(false);
        lblCS.setVisible(false);
        lblCA.setVisible(false);
        lblRM.setVisible(false);
        lblRV.setVisible(false);
        lblCU.setVisible(false);
        lblBD.setVisible(false);
        lblBI.setVisible(false);
        lblPD.setVisible(false);
        lblPI.setVisible(false);
        lbl7.setVisible(false);
        lbl8.setVisible(false);
        lbl9.setVisible(false);
        lbl10.setVisible(false);
        Limpiar();
    }
    
    public void Limpiar()
    {
        lbl1.setText("_");
        lbl2.setText("_");
        lbl3.setText("_");
        lbl4.setText("_");
        lbl5.setText("_");
        lbl6.setText("_");
        lbl7.setText("_");
        lbl8.setText("_");
        lbl9.setText("_");
        lbl10.setText("_");
    }
    
    public void Equivocado()
    {
        val ++;
        
        switch (val)
        {
            case 1:
                lblSM.setVisible(true);
                break;
            case 2:
                lblSA.setVisible(true);
                break;
            case 3:
                lblRV.setVisible(true);
                break;
            case 4:
                lblCU.setVisible(true);
                break;
            case 5:
                lblBD.setVisible(true);
                lblBI.setVisible(true);
                break;
            case 6:
                lblPD.setVisible(true);
                lblPI.setVisible(true);
                break;
            case 7:
                lblCS.setVisible(true);
                break;
            case 8:
                lblCS.setVisible(false);
                lblRV.setVisible(false);
                lblRM.setVisible(true);
                lblCA.setVisible(true);
                break;
            default:
                Ocultar();
                break;
        }
        if(val == 8)
        {
            JOptionPane.showMessageDialog(null, "La palabra era: "+ Palabra, "Respuesta", 1); 
            int xD = JOptionPane.showConfirmDialog(null, "Has perdido... ¿Quieres Volver a Empezar?", "Juego Terminado", JOptionPane.YES_NO_OPTION);
            if(xD == 0)
            {
                Ocultar();
                val = 0;
                Palabra = "";                
            }
            else
            {
                System.exit(0);
            }
        }
    }
    
    public void CapPalabra(String pal)
    {
        Palabra = pal;
    }

    public void Crear()
    {
        int cant = Palabra.length();
        for(int i = 0; i<= cant; i++)
        {
            
                
        }
    }
    
    public void PonerLetra(int a)
    {
        switch (a)
        {
            case 1:
                lbl1.setText(let);
                break;
            case 2:
                lbl2.setText(let);
                break;
            case 3:
                lbl3.setText(let);
                break;
            case 4:
                lbl4.setText(let);
                break;
            case 5:
                lbl5.setText(let);
                break;
            case 6:
                lbl6.setText(let);
                break;
            case 7:
                lbl7.setText(let);
                break;
            case 8:
                lbl8.setText(let);
                break;
            case 9:
                lbl9.setText(let);
                break;
            case 10:
                lbl10.setText(let);
                break;
        }
    }
    

}
